package com.dbManage.webService;

import com.dbManage.dao.YlDao;
import com.dbManage.entity.YlBean;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;
@Controller
public class TestController {
    @Resource
    YlDao ylDao;

    @RequestMapping("testList")
    @ResponseBody
    public List<YlBean> test() {
        List<YlBean> list=ylDao.findAll();
        return list;
    }
    @RequestMapping("testBean")
    @ResponseBody
    public YlBean test(int id) {
        YlBean ylBean=ylDao.findAllById(id);
        return ylBean;
    }
}
